package Demo02.Demo07;

import java.io.*;

public class Demo_CopyVido {
    public static void main(String[] args) throws IOException {
        buffStreamCopy();
    }

    private static void buffStreamCopy() throws IOException {
        BufferedInputStream bif = new BufferedInputStream(new FileInputStream("G:\\XQ1.01\\1.mp4"));
        BufferedOutputStream fos = new BufferedOutputStream(new FileOutputStream("G:\\sgiping"));
        byte[] bytes = new byte[1024];
        int len;
        long begin= System.currentTimeMillis();
        while ((len = bif.read(bytes))!=-1){
            fos.write(bytes,0,len);
        }
        long end = System.currentTimeMillis();
        System.out.println("复制文件完成，共耗时：" + (end - begin) + "毫秒");//1
        bif.close();
        fos.close();
    }
}
